package com.start.common.entity;

import com.start.common.model.StartBaseTreeModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class StartBaseMenu<T extends StartBaseTreeModel<T>> extends StartBaseTreeModel<T> {
    @Schema(name = "权限编码")
    private String code;
    @Schema(name = "图标")
    private String icon;
    @Schema(name = "名称")
    private String label;
    @Schema(name = "菜单类型", description = "0 菜单 1按钮")
    private int type;
    @Schema(name = "菜单方向", description = "0左边 1上边")
    private int directionType;
    @Schema(name = "打开类型", description = "0 内部 1外部新窗口")
    private int openType;
    @Schema(name = "路径")
    private String path;
    @Schema(name = "前端组件")
    private String component;
    @Schema(name = "系统创建编码")
    private String systemCode;
    @Schema(name = "是否系统添加")
    private Boolean isSystemAdd;
    @Schema(name = "路径参数")
    private String pathParameter;
    @Schema(name = "动态表id")
    private String dynamicFormId;
    @Schema(name = "是否缓存 ", description = "0 不缓存 1 缓存")
    private boolean keepAlive;

    @Schema(name = "客户端类型")
    private String clientType;

    @Schema(name = "是否显示", description = "0 隐藏 1显示")
    private Integer isDisplay;

    @Schema(name = "是否启用", description = "0 未启用 1启用")
    private boolean isEnable = true;
    @Schema(name = "排序序号")
    private int sort;

    public static StartBaseMenu createBtn(String code, String label, String parentId) {
        StartBaseMenu menu = new StartBaseMenu();
        menu.setLabel(label);
        menu.setCode(code);
        menu.setParentId(parentId);
        menu.setType(1);
        return menu;
    }

}
